package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.service.GoodsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zjr
 * @version 1.0
 */
@RestController
@RequestMapping("/goodsType/")
public class GoodsTypeController {
    @Autowired
    GoodsTypeService service;
    @PostMapping("loadGoodsType")
    public String loadGoodsType(){
        return service.loadGoodsType();
    }
    @PostMapping("save")
    public ServiceVO addType(String  goodsTypeName,Integer  pId){
        return service.addType(goodsTypeName,pId);
    }
    @PostMapping("delete")
    public ServiceVO deleteType(Integer  goodsTypeId){
        return service.deleteById(goodsTypeId);
    }
}
